/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86155
 * date: 2024-03-09
 * Time: 17:17
 *
 * @author 继承
 */
class People{
    private String name;
    public int age;


    public void eat(){
        System.out.println(age +"岁 "+name + "在吃饭");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
class Dog extends People{



    public void barks(){
        System.out.println("汪汪叫！");
    }
}
class Cat extends People{

    public void cathMouse(){
        System.out.println("抓老鼠");
    }
}
public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.setName("阿黄");
        dog.age = 13;
        System.out.println(dog.getName());
        dog.eat();

    }
}
